package com.jianbo.proxy.page;

import org.smartboot.http.server.HttpResponse;

import com.jianbo.proxy.util.ContentTypeUtil;
import com.jianbo.proxy.util.ResourceUtil;

public class Page404 {

    public static void flush(HttpResponse response) {
        try {
            byte[] bytes = ResourceUtil.read("page/404.html");
            String contentType = ContentTypeUtil.contentType("html");
            response.setContentType(contentType);
            response.getOutputStream().write(bytes);
            response.getOutputStream().flush();
            response.close();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

}
